import express from "express"
import path from "path"
import { createProxyMiddleware } from "http-proxy-middleware"
import dotenv from "dotenv"

import cors from "cors"

const config = Object.assign(
	dotenv.config().parsed,
	dotenv.config({ path: path.resolve(process.cwd(), ".env." + process.env.NODE_ENV) }).parsed
);

const app = express();

// 设置允许跨域访问该服务
app.use(cors({origin:true,credentials: true}));





app.use('/wap', createProxyMiddleware({ target: config.VITE_API_PROXY, changeOrigin: true  }));



app.listen(4333);

